package com.chookss.tiku;

import android.os.Bundle;
import android.widget.TextView;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.tabs.TabLayout;
import com.chookss.R;
import com.chookss.view.consecutivescroller.TabPagerAdapter;
import com.lvgroup.hospital.base.BaseAct;

import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
//答题记录列表页
public class ExamRecordListActivity extends BaseAct {
    @BindView(R.id.common_title_txt)
    TextView commonTitleTxt;
    @BindView(R.id.tabLayout)
    TabLayout tabLayout;
    @BindView(R.id.viewPager)
    ViewPager viewPager;
    private ArrayList<Fragment> fragments = new ArrayList<>();
    private TabPagerAdapter mAdapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_exam_recordlist);
        ButterKnife.bind(this);

    }

    @Override
    public void initData() {
     initState();
        commonTitleTxt.setText("答题记录");
        for (int i = 0; i <6 ; i++) {
            if(i==0){
                fragments.add(new ExamRecordFragment(""));
            }else{
                fragments.add(new ExamRecordFragment(i+""));
            }

        }
        List<String> tabs = new ArrayList<>();
        tabs.add("全部");
        tabs.add("智能");
        tabs.add("专项");
        tabs.add("模拟卷");
        tabs.add("考试");
        tabs.add("背题");
        mAdapter = new TabPagerAdapter(getSupportFragmentManager(), tabs,fragments);
        viewPager.setAdapter(mAdapter);
        tabLayout.setupWithViewPager(viewPager);
    }

    @OnClick(R.id.common_title_back)
    public void onClick() {
        finish();
    }
}
